package end.TEST;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

/**
 * 
 * FileReaderTest 下午5:11:57 Copyright HEXUNz Inc. All right reserved. Email :
 * alldios@outlook.com
 * 
 */
public class FileReaderTest {
	@Test
	public void test1() throws Exception {
		InputStreamReader read = new InputStreamReader(new FileInputStream(
				new File("E:/highchart使用本地生成")), "utf-8");// 考虑到编码格式
		String readLine = null;
		BufferedReader bufferedReader = new BufferedReader(read);
		while ((readLine = bufferedReader.readLine()) != null) {
			System.out.println(readLine);
		}
		bufferedReader.close();
	}

	@Test
	public void test2() throws IOException {
		List<String> readLines = FileUtils.readLines(new File(
				"E:/highchart使用本地生成"));
		for (String string : readLines) {
			System.out.println(string);
		}
	}
}
